package com.java.business.controller;

import com.java.business.model.Complaint;
import com.java.business.service.ComplaintService;
import com.java.common.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/complaint")
public class ComplaintController {

    @Autowired
    private ComplaintService complaintService;

    @PostMapping("/list")
    public Result list(@RequestBody Complaint complaint){
        return complaintService.list(complaint);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Complaint complaint) {
        return complaintService.save(complaint);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Complaint complaint) {
        return complaintService.modify(complaint);
    }

    @GetMapping("/remove")
    public Result remove(int[] ids) {
        return complaintService.remove(ids);
    }
}
